package models.mapper;

import java.util.List;
import java.util.Map;

import models.DrSecret;
import models.DrSecretExample;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import vos.Node;

public interface DrSecretMapper {
    int countByExample(DrSecretExample example);

    int deleteByExample(DrSecretExample example);

    int deleteByPrimaryKey(String id);

    int insert(DrSecret record);

    int insertSelective(DrSecret record);

    List<DrSecret> selectByExample(DrSecretExample example);

    DrSecret selectByPrimaryKey(String id);

    int updateByExampleSelective(@Param("record") DrSecret record, @Param("example") DrSecretExample example);

    int updateByExample(@Param("record") DrSecret record, @Param("example") DrSecretExample example);

    int updateByPrimaryKeySelective(DrSecret record);

    int updateByPrimaryKey(DrSecret record);
    /**
     * 获取密级下拉框
     * @return
     */
    @Select("select id,secretname as text from Dr_SECRET order by id asc")
	List<Node> getRoleComboBox();
    /**
     * 获取最大密级的id
     * @return
     */
    @Select("select id from dr_secret where selev=(select max(selev) from dr_secret)")
	List<String> getMaxLevel();
    /**
     * 获取最小密级的id
     * @return
     */
    @Select("select id from dr_secret where selev=(select min(selev) from dr_secret)")
	List<String> getMinLevel();
    /**
     * 获取小于等于当前密级
     * @param secretLevel
     * @return
     */
    @Select("select id,secretname as text from Dr_SECRET where SELEV<=#{secretLevel}  order by id asc ")
	List<Node> getRoleLevelComboBox(String secretLevel);
}